<script>
    $(function () {
        var a = $;
        '<?php foreach($unite as $item){ $keyAll = [];$valueAll = [];foreach($item["value"] as $key=> $value){ $keyAll[] = $key;$valueAll[] = $value;}?>'
        '<?php $filed = $item["key"];$keys = $filed . "_key";$values = $filed . "_value"; ?>'
        var {$keys} = JSON.parse('<?php echo json_encode($keyAll);?>'),
            {$values} = JSON.parse('<?php echo json_encode($valueAll);?>');
        layui.form.on('select({$filed})', function (d) {
            var c = {$keys}.indexOf(parseInt(d.value));
            for (var i = 0; i < {$values}.length; i++) {
                for (var j = 0; j < {$values}[i].length; j++) {
                    i === c ? a('#AUTO-' + {$values}[i][j]).show() : a('#AUTO-' + {$values}[i][j]).hide();
                }
            }
        });

        if(a("select[name='{$filed}']").val()){
            var c = {$keys}.indexOf(parseInt(a("select[name='{$filed}']").val()));
            console.log({$values})
            for (var i = 0; i < {$values}.length; i++) {
                for (var j = 0; j < {$values}[i].length; j++) {
                    i === c ? a('#AUTO-' + {$values}[i][j]).show() : a('#AUTO-' + {$values}[i][j]).hide();
                }
            }
        }
        '<?php }?>'
    })
</script>